package com.example.adminframework.common.exception;


import com.example.adminframework.constant.ErrorCode;
import com.example.adminframework.constant.HttpCode;

/**
 * 类描述：自定义公用异常
 */
public class CommonException extends RuntimeException {
    /**
     * httpCode
     */
    private HttpCode httpCode;
    /**
     * errorCode
     */
    private ErrorCode errorCode;

    public HttpCode getHttpCode() {
        return httpCode;
    }

    public void setHttpCode(HttpCode httpCode) {
        this.httpCode = httpCode;
    }

    public ErrorCode getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(ErrorCode errorCode) {
        this.errorCode = errorCode;
    }

    public CommonException() {
    }

    public CommonException(HttpCode httpCode, ErrorCode errorCode) {
        this.httpCode = httpCode;
        this.errorCode = errorCode;
    }

    @Override
    public String toString() {
        return "CommonException{" +
                "httpCode=" + httpCode +
                ", errorCode=" + errorCode +
                '}';
    }
}
